/*-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License.You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
	
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
	
The Original Code is Fever RS ( ActionScript 3 ) Framework code.
	
The Initial Developer of the Original Code is Romain Ecarnot.
Portions created by Initial Developer are Copyright (C) 2006
the Initial Developer. All Rights Reserved.
	
Contributor(s):
	
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----------------------------------------------------------------------------*/

package fever.app.context 
{
	import com.bourre.structures.Point;
	import com.bourre.structures.Rectangle;
	
	import fever.ui.menu.PopupContextMenu;	
	/**
	 * Dispatched when the application is resized.
	 *
	 * @eventType fever.events.FeverEvent.onResizeEVENT
	 */
	[Event(name="onResize", type="fever.events.FeverEvent")]

	/**
	 * Dispatched when the application is moved.
	 *  
	 * <p>Not available in all application context</p>.
	 *
	 * @eventType fever.events.FeverEvent.onMoveEVENT
	 */
	[Event(name="onMove", type="fever.events.FeverEvent")]

	/**
	 * Dispatched when the application's title changed.
	 *  
	 * @eventType fever.events.FeverEvent.onTitleChangeEVENT
	 */
	[Event(name="onTitleChange", type="fever.events.FeverEvent")]

	/**
	 * Control application <strong>container</strong> using 
	 * Fever <strong>context API</strong>.
	 * 
	 * <p>Somes context strategy are already implemented in Fever :
	 * <ul>
	 *   <li><strong>Web browser</strong> container.</li>
	 *   <li><strong>Adobe AIR</strong> container.</li>
	 *   <li><strong>Northcode SWF Studio</strong> container.</li>
	 *   <li><strong>mdm Zinc</strong> container.</li>
	 * </ul></p>
	 * 
	 * @see fever.app.context.air
	 * @see fever.app.context.browser
	 * @see fever.app.context.swfs
	 * @see fever.app.context.zinc
	 * 
	 * @author Romain Ecarnot
	 */
	public interface ApplicationContainer 
	{
		/**
		 * Main container context menu.
		 */
		function get contextMenu( ) : PopupContextMenu;
		/** @private */
		function set contextMenu( m : PopupContextMenu ) : void;
		
		/**
		 * Sets application window title.
		 * 
		 * @param mainTitle Main part of the title ( pass <code>null</code> 
		 * to keep current )
		 * @param subTitle title complement ( pass <code>null</code> to 
		 * keep current )
		 * @param historyCaption used to show history place 
		 * ( pass <code>null</code> to keep current )
		 * 
		 * </td></tr></tbody></table>
		 * <p><span class="label">Events</span>
		 * <ul><table class="innertable">
	     * 	<tr><th>Event type</th><th>Description</th></tr>
	     *  
	     *  <tr>
	     *  	<td><a href="#event:onTitleChange">onTitleChange</a></td>
	     *  	<td>when the application's title changed</td>
	     *  </tr>
	     *  </ul></table></p>		 */
		function setTitle( mainTitle : String = null, 
			subTitle : String = null, historyCaption : String = null ) : void

		/**
		 * Returns the window title.
		 */
		function getTitle() : String;

		/**
		 * Returns main title ( without sub or history part )
		 */
		function getMainTitle() : String;

		/**
		 * Returns sub title ( without main or history part )
		 */
		function getSubTitle() : String;

		/**
		 * Returns history title ( without main or sub part )
		 */
		function getHistoryTitle() : String;

		/**
		 * Set the window position.
		 * 
		 * @param x Window position on X-Axis		 * @param y Window position on Y-Axis
		 * 
		 * </td></tr></tbody></table>
		 * <p><span class="label">Events</span>
		 * <ul><table class="innertable">
	     * 	<tr><th>Event type</th><th>Description</th></tr>
	     *  
	     *  <tr>
	     *  	<td><a href="#event:onMove">onMove</a></td>
	     *  	<td>when window has moved</td>
	     *  </tr>
	     *  </ul></table></p>
		 */
		function move( x : int, y : int ) : void;

		/**
		 * Returns the container position.
		 */
		function getLocation() : Point;

		/**
		 * Set the window size.
		 * 
		 * @param width New window's width		 * @param height New window's height
		 * 
		 * </td></tr></tbody></table>
		 * <p><span class="label">Events</span>
		 * <ul><table class="innertable">
	     * 	<tr><th>Event type</th><th>Description</th></tr>
	     *  
	     *  <tr>
	     *  	<td><a href="#event:onResize">onResize</a></td>
	     *  	<td>when window is resized</td>
	     *  </tr>
	     *  </ul></table></p>
		 */
		function setSize( width : int, height : int ) : void;

		/**
		 * Returns the window size.
		 */
		function getSize() : Rectangle;

		/**
		 * Defines fullscreen mode of application.
		 * 
		 * @event onResize fever.events.FeverEvent Dispatched to 
		 * application container listeners when window is resized
		 */
		function setFullScreenMode( b : Boolean ) : void;

		/**
		 * Returns <code>true</code> if stage is in full-screen mode.
		 */
		function isFullScreen() : Boolean;

		/** 
		 * Maximize application window.
		 * 
		 * </td></tr></tbody></table>
		 * <p><span class="label">Events</span>
		 * <ul><table class="innertable">
	     * 	<tr><th>Event type</th><th>Description</th></tr>
	     *  
	     *  <tr>
	     *  	<td><a href="#event:onResize">onResize</a></td>
	     *  	<td>when window is resized</td>
	     *  </tr>
	     *  </ul></table></p>
		 */
		function maximize() : void

		/** 
		 * Minimize application window.
		 * 
		 * </td></tr></tbody></table>
		 * <p><span class="label">Events</span>
		 * <ul><table class="innertable">
	     * 	<tr><th>Event type</th><th>Description</th></tr>
	     *  
	     *  <tr>
	     *  	<td><a href="#event:onResize">onResize</a></td>
	     *  	<td>when window is resized</td>
	     *  </tr>
	     *  </ul></table></p>
		 */
		function minimize() : void

		/** 
		 * Restore application window.
		 * 
		 * </td></tr></tbody></table>
		 * <p><span class="label">Events</span>
		 * <ul><table class="innertable">
	     * 	<tr><th>Event type</th><th>Description</th></tr>
	     *  
	     *  <tr>
	     *  	<td><a href="#event:onResize">onResize</a></td>
	     *  	<td>when window is resized</td>
	     *  </tr>
	     *  </ul></table></p>
		 */
		function restore() : void

		/**
		 * Returns application argument associated with 
		 * <code>id</code> identifier.
		 * 
		 * @param id Argument identifier 
		 */
		function getArgument( id : String ) : String;
	}
}